<?php

class Controller_Test_HttpCache extends Controller_Test_Abstract
{
    public function lastModifiedAction()
    {
        Core_Response::lastModified(strtotime('2013-01-02 03:04:05'));

        echo date('Y-m-d H:i:s');
        Com_Log::write('HTTP-lastModified', uniqid());

        return false;
    }

    public function etagsAction()
    {
        return false;
    }

    // 等同 max-age 的效果。但是如果同时存在，则 expires 无效，被 max-age 覆盖
    public function expiresAction()
    {
        Core_Response::expires(-1000);

        echo '<a href="">' . date('Y-m-d H:i:s') . '</a>';
        Com_Log::write('HTTP-expires', uniqid());

        return false;
    }

    public function maxAgeAction()
    {
        Core_Response::maxAge(500);

        echo '<a href="">' . date('Y-m-d H:i:s') . '</a>';
        Com_Log::write('HTTP-expires', uniqid());

        return false;
    }

    public function ajaxAction()
    {

    }
}